package com.szholly.data.jdbc.sqlserver;
 

public class test1 {
	public static void main(String[] args) {
		DBHelper help = new DBHelper();
		/*
		 * if(help.TestConn()) System.out.println("连接成功1"); else
		 * System.out.println("连接失败1");
		 */

		// JOptionPane.showMessageDialog(null, "hello world");

		// String sSQL="select * from w_brand where id=? and brand_name =?";

		String sSQL = "select * from w_brand where id=? and brand_name like '%{0}%'";
		sSQL = sSQL.replace("{0}", "柔");
		Object[] oParams = new Object[1];
		oParams[0] = 5;
		// oParams[1]="柔";

		/*
		 * ResultSet rs=help.GetResultSet(sSQL, oParams); try { if(rs.next())
		 * System.out.println("id: " + rs.getString(1) + " brand_name: " +
		 * rs.getString(2)); ////索引从1开始 }catch(Exception ex) {
		 * System.out.println(ex.getMessage()); }finally { try { rs.close();
		 * }catch(Exception ex) { System.out.println(ex.getMessage()); } }
		 */

		Object oResult = help.GetSingle(sSQL, oParams);
		if (oResult != null)
			System.out.println(oResult.toString());
		else
			System.out.println("没有符合条件的数据");

		// DataTable dt=help.GetDataTable(sSQL,oParams);

		/*
		 * String sSQL="select * from w_brand"; DataTable
		 * dt=help.GetDataTable(sSQL);
		 */

		/*
		 * try { int iRowCount = dt.RowCount; int iColumnCount = dt.ColumnCount;
		 * System.out.println("行数:" + iRowCount + ",列数:" + iColumnCount);
		 * DataTable.PrintTable(dt); //rs.last(); //System.out.println("数据行：" +
		 * rs.getRow()); }catch(Exception ex) { System.out.println("错误提示：" +
		 * ex.getMessage()); }
		 */
	}
}